package research.toe.duangjarern.Helper;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.Locale;

import research.toe.duangjarern.QuestionTypeTwoFragment;

/**
 * Created by nipitponmuensan on 3/5/15 AD.
 */
public class TypeTwoAdapter extends FragmentPagerAdapter {

    private int CountFrag = 0;

    private int getCountFrag() {
        return CountFrag;
    }

    public void setCountFrag(int countFrag) {
        CountFrag = countFrag;
    }

    public TypeTwoAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int position) {
        // getItem is called to instantiate the fragment for the given page.
        // Return a PlaceholderFragment (defined as a static inner class below).
        return QuestionTypeTwoFragment.newInstance(position + 1);
    }

    @Override
    public int getCount() {
        // Show 3 total pages.
        return CountFrag;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        Locale l = Locale.getDefault();
//        switch (position) {
//            case 0:
//                return getString(R.string.title_section1).toUpperCase(l);
//            case 1:
//                return getString(R.string.title_section2).toUpperCase(l);
//            case 2:
//                return getString(R.string.title_section3).toUpperCase(l);
//        }
        return null;
    }

}
